package org.laobai.common.aspect;

import org.laobai.common.exception.BPException;
import org.laobai.common.struct.Result;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class BPExceptionHandler {


    @ExceptionHandler(BPException.class)
    public Result<String> handler(BPException exception){
        exception.printStackTrace();

        return Result.ok(exception.getMsg());
    }
}
